#!/bin/sh
#
# $FreeBSD$

# some defs
GENKDMCONF=%%PREFIX%%/bin/genkdmconf
KDMCONFDIR=%%PREFIX%%/share/config/kdm

#Configure kdm if needed
if [ ! -r ${KDMCONFDIR}/kdmrc ]; then
	echo "Generating KDM configuration";
	${GENKDMCONF} --no-old --in ${KDMCONFDIR};
else
	echo "Updating KDM configuration";
	${GENKDMCONF} --in ${KDMCONFDIR};

fi

#run kdm
exec "%%PREFIX%%/bin/kdm-bin" "$@"
